/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IUserCardTF interface for NHibernate mapped table 'UserCardTF'.
	/// </summary>
	public interface IUserCardTF
	{
		#region Public Properties
		
		int uctf_id
		{
			get ;
			set ;
			  
		}
		
		int uctf_ucid
		{
			get ;
			set ;
			  
		}
		
		decimal uctf_fy
		{
			get ;
			set ;
			  
		}
		
		decimal uctf_yj
		{
			get ;
			set ;
			  
		}
		
		string uctf_bz
		{
			get ;
			set ;
			  
		}
		
		int uctf_user
		{
			get ;
			set ;
			  
		}
		
		DateTime uctf_addTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// UserCardTF object for NHibernate mapped table 'UserCardTF'.
	/// </summary>
	[Serializable]
	public class UserCardTF : ICloneable,IUserCardTF
	{
		#region Member Variables

		protected int _uctf_id;
		protected int _uctf_ucid;
		protected decimal _uctf_fy;
		protected decimal _uctf_yj;
		protected string _uctf_bz;
		protected int _uctf_user;
		protected DateTime _uctf_addtime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public UserCardTF() {}
		
		public UserCardTF(int puctfucid, decimal puctffy, decimal puctfyj, string puctfbz, int puctfuser, DateTime puctfaddTime)
		{
			this._uctf_ucid = puctfucid; 
			this._uctf_fy = puctffy; 
			this._uctf_yj = puctfyj; 
			this._uctf_bz = puctfbz; 
			this._uctf_user = puctfuser; 
			this._uctf_addtime = puctfaddTime; 
		}
		
		public UserCardTF(int puctfucid, decimal puctffy, decimal puctfyj, int puctfuser)
		{
			this._uctf_ucid = puctfucid; 
			this._uctf_fy = puctffy; 
			this._uctf_yj = puctfyj; 
			this._uctf_user = puctfuser; 
		}
		
		public UserCardTF(int puctfid)
		{
			this._uctf_id = puctfid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int uctf_id
		{
			get { return _uctf_id; }
			set { _bIsChanged |= (_uctf_id != value); _uctf_id = value; }
			
		}
		
		public virtual int uctf_ucid
		{
			get { return _uctf_ucid; }
			set { _bIsChanged |= (_uctf_ucid != value); _uctf_ucid = value; }
			
		}
		
		public virtual decimal uctf_fy
		{
			get { return _uctf_fy; }
			set { _bIsChanged |= (_uctf_fy != value); _uctf_fy = value; }
			
		}
		
		public virtual decimal uctf_yj
		{
			get { return _uctf_yj; }
			set { _bIsChanged |= (_uctf_yj != value); _uctf_yj = value; }
			
		}
		
		public virtual string uctf_bz
		{
			get { return _uctf_bz; }
			set 
			{
			  if (value != null && value.Length > 800)
			    throw new ArgumentOutOfRangeException("uctf_bz", "uctf_bz value, cannot contain more than 800 characters");
			  _bIsChanged |= (_uctf_bz != value); 
			  _uctf_bz = value; 
			}
			
		}
		
		public virtual int uctf_user
		{
			get { return _uctf_user; }
			set { _bIsChanged |= (_uctf_user != value); _uctf_user = value; }
			
		}
		
		public virtual DateTime uctf_addTime
		{
			get { return _uctf_addtime; }
			set { _bIsChanged |= (_uctf_addtime != value); _uctf_addtime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			UserCardTF castObj = null;
			try
			{
				castObj = (UserCardTF)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._uctf_id == castObj.uctf_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _uctf_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for UserCardTF 

	
	public interface IUserCardTFCollection : ICollection
	{
		UserCardTF this[int index]{	get; set; }
		void Add(UserCardTF pUserCardTF);
		void Clear();
	}
	
	[Serializable]
	public class UserCardTFCollection : IUserCardTFCollection
	{
		private IList<UserCardTF> _arrayInternal;

		public UserCardTFCollection()
		{
			_arrayInternal = new List<UserCardTF>();
		}
		
		public UserCardTFCollection( IList<UserCardTF> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<UserCardTF>();
			}
		}

		public UserCardTF this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((UserCardTF[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(UserCardTF pUserCardTF) { _arrayInternal.Add(pUserCardTF); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<UserCardTF> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
